package cn.tansanqinger.controller.topic;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import cn.tansanqinger.service.hymenu.IHyMenuServer;

/**
 * 题库页面首页
 * @author C3H2
 * @time 12月
 */
@Controller
@RequestMapping("/topic")
public class TopicIndexController {
	
	@Autowired
	private IHyMenuServer hyMenuServer;
	
	//单选题
	@RequestMapping("/listSingle")
	public ModelAndView listSingle(ModelAndView mv, HttpServletRequest request) {
		mv = hyMenuServer.selectHyMenuAll(mv);
		mv.addObject("typeValue", 0);
		mv.addObject("user", request.getSession().getAttribute("user"));
		mv.setViewName("topic/selectTopic");
		return mv;
	}
	
	//多选题
	@RequestMapping("/listMultiterm")
	public ModelAndView listMultiterm(ModelAndView mv, HttpServletRequest request) {
		mv = hyMenuServer.selectHyMenuAll(mv);
		mv.addObject("typeValue", 1);
		mv.addObject("user", request.getSession().getAttribute("user"));
		mv.setViewName("topic/selectTopic");
		return mv;
	}
	
	//判断题
	@RequestMapping("/listJudgeg")
	public ModelAndView listJudgeg(ModelAndView mv, HttpServletRequest request) {
		mv = hyMenuServer.selectHyMenuAll(mv);
		mv.addObject("typeValue", 2);
		mv.addObject("user", request.getSession().getAttribute("user"));
		mv.setViewName("topic/selectTopic");
		return mv;
	}
	
	//填空题
	@RequestMapping("/listPapfilling")
	public ModelAndView listPapfilling(ModelAndView mv, HttpServletRequest request) {
		mv = hyMenuServer.selectHyMenuAll(mv);
		mv.addObject("typeValue", 3);
		mv.addObject("user", request.getSession().getAttribute("user"));
		mv.setViewName("topic/selectTopic");
		return mv;
	}
	
	//计算题
	@RequestMapping("/listCalculate")
	public ModelAndView listCalculate(ModelAndView mv, HttpServletRequest request) {
		mv = hyMenuServer.selectHyMenuAll(mv);
		mv.addObject("typeValue", 4);
		mv.addObject("user", request.getSession().getAttribute("user"));
		mv.setViewName("topic/selectTopic");
		return mv;
	}
}
